<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sugar</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.20.0/axios.min.js"></script>
</head>

<body>
  <button>按钮</button>
  <script>
    const button = document.querySelector('button');

    // button.addEventListener('click', () => {
    //   axios.get('http://157.122.54.189:9060/home/swiper')
    //     .then(res => {
    //       console.log('拿到对应数据', res.data.body);
    //     });
    // });

    button.addEventListener('click', async () => {
      const res = await axios.get('http://157.122.54.189:9060/home/swiper');
      console.log(res.data.body);
    });
  </script>
</body>

</html>